package com.jxc.service.impl;

import com.jxc.entity.Role;
import com.jxc.repository.RoleRepository;
import com.jxc.service.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 角色Service接口实现
 *
 * @author 高旭
 * @date 2021-03-22
 */
@Service("roleService")
public class RoleServiceImpl implements RoleService {

    @Resource
    private RoleRepository roleRepository;

    @Override
    public List<Role> findByUserName(String userName) {
        return roleRepository.findByUserName(userName);
    }

    @Override
    public List<Role> findByUserId(Integer userId) {
        return roleRepository.findByUserId(userId);
    }

    @Override
    public Role findOneById(Integer id) {
        return roleRepository.findOne(id);
    }
}
